<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="keywords" content="{{keywords}}">
    <meta name="description" content="{{description}}">
    <title>{{title}}</title>
    <link rel="stylesheet" href="/public/stylesheets/common/bootstrap.css">
    <link rel="stylesheet" href="/public/stylesheets/common/colpick.css">
    <link rel="stylesheet" href="/public/stylesheets/index.css">
    <script>
    //  document.style.fontSize
    </script>
    {{block 'style'}} {{/block}}
    {{include './template/requireConfig.html'}}
</head>

<body style="background: rgb(254, 254, 254);">

    <!-- node服务器地址 -->
    <nav class="navbar navbar-expand-lg navbar-light bg-light shadow p-3 mb-5 bg-white rounded"  >

        <a class="navbar-brand" href="/personal">
            <img src="/public/images/log.jpg" style="height:50px;width:50px; border-radius: 50%;" alt="">

        </a>
     
       
           <!-- 缩小展示 -->
           <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
           aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
           <span class="navbar-toggler-icon"></span>
       </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
               
                <ul class="navbar-nav mr-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="#">最新</a>
                      </li>
                    {{each nav value index}}
                    <li class="nav-item">
                        <a class="nav-link"  href="/?categoryId={{@value._id}}">  {{value.name}}</a>
                        </li>
                    {{/each}}
                        <!-- <li class="nav-item active">
                              <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
                            </li>
                            <li class="nav-item">
                              <a class="nav-link" href="#">Link</a>
                            </li> -->
                        <!-- <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="false">
                                前端技术站
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                                {{each nav value index}}
                                <a class="dropdown-item" href="/?categoryId={{@value._id}}">
                                    {{value.name}}
                                </a>
                                {{/each}}
                                <a class="dropdown-item" href="#">Action</a>
                                <a class="dropdown-item" href="#">Another action</a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="#">Something else here</a> -->
                            <!-- </div>
                        </li>   -->
                    </ul>
            <!-- <h2 style="margin:auto;  text-align: center;">JACKY</h2> -->
            <!-- <div class="btn-group navbar-nav " style="margin:5px">
                    <button class="btn btn-outline-info"  
                    id="picker" >color</button>
                </div> -->
            <!-- {{if userInfo && userInfo.userName}}
            <div class="btn-group navbar-nav " style="margin:5px">
                {{if userInfo.isAdmin}}
                <button type="button" class="btn btn-warning"> Welcome back administrator：
                    {{ userInfo.userName}}</button>
                {{else}}
                <button type="button" class="btn btn-warning"> hello： {{ userInfo.userName}}</button>
                {{/if}}
                <button type="button" class="btn btn-warning dropdown-toggle dropdown-toggle-split"
                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <span class="sr-only">Toggle Dropdown</span>
                </button>
                <div class="dropdown-menu">
                    <a class="dropdown-item" href="/users/exitLogin">exit</a>
                    <a class="dropdown-item" href="/users/exitLogin">cancel</a>
                    {{if userInfo.isAdmin}}
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="/admin">Go into background Settings</a>
                    {{/if}}

                </div>
            </div>
            {{else}}
          
            <div class="btn-group navbar-nav " style="margin:5px">
                <button class="btn btn-outline-info" type="submit" data-toggle="modal"
                    data-target="#login">login</button>
            </div>

            <div class="btn-group navbar-nav " style="margin:5px">
                <button class="btn btn-outline-info" type="submit" data-toggle="modal"
                    data-target="#register">register</button>
            </div>

            {{/if}} -->
           
            <div  >
                <ul class="navbar-nav mr-auto">
                    {{if userInfo && userInfo.userName}}
                    <li class="nav-item">
                        <span class="nav-link">
                            {{if userInfo.isAdmin}} 
                            你好: {{ userInfo.userName}} 
                            <a  class="nav-link" style="display: unset;" href="/admin">后台</a>
                            {{else}}
                             欢迎回来：{{ userInfo.userName}}
                             {{/if}}
                             <a  class="nav-link" style="display: unset;" href="/users/exitLogin">退出登录</a>
                        </span>
                       
                         
                      </li>
                      {{else}}
                      <li class="nav-item">
                        <a class="nav-link" href="#" data-toggle="modal"
                        data-target="#login" >登录</a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link" href="#" data-toggle="modal"
                        data-target="#register"  >注册</a>
                      </li>
                      {{/if}}
                    </ul>
            </div>
            <div class="row ">
                
                <div class="col-8" style="padding-right:0px ">
                    <input class="form-control   " type="search" placeholder="Search" aria-label="Search">

                </div>
                <div class="col-4" style="padding-left:0px">
                    <button class="btn btn-outline-success col-sm-12 col-xl-12 " type="submit">Search</button>

                </div>
            </div>

          
            <!-- <div class="btn-group navbar-nav " style="margin:5px">
               </div> -->

        </div>
    </nav>
    {{block 'head'}}
    {{/block}}
    <div class="container" >
        {{block  'content'}}

        {{/block}}

    </div>
    <!-- <div class="card text-white bg-dark  " style="border-radius:0px">
        <div class="card-header">Header</div>
        <div class="card-body container">
            <h5 class="card-title">All rights reserved by the developer</h5>
            <p class="card-text " style="text-align:center">All rights of interpretation belong to the author</p>
        </div>
    </div> -->


    {{block 'js_script'}}
    {{/block}}

    <!-- 登陆 -->
    <div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">login</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <label for="recipient-name" class="col-form-label">用户名:</label>
                            <input type="text" class="form-control" name="userName">
                        </div>
                        <div class="form-group">
                            <label for="recipient-name" class="col-form-label">密码:</label>
                            <input type="password" class="form-control" name="password">
                        </div>
                        <div class="alert alert-danger" name="errorMessage" style="display:none" role="alert">

                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="loginSubmit">登录</button>
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 注册 -->
    <div class="modal fade" id="register" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">register</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <label for="recipient-name" class="col-form-label">用户名:</label>
                            <input type="text" class="form-control" name="userName">
                        </div>
                        <div class="form-group">
                            <label for="recipient-name" class="col-form-label">密码:</label>
                            <input type="password" class="form-control" name="password">
                        </div>
                        <div class="form-group">
                            <label for="recipient-name" class="col-form-label">重复密码:</label>
                            <input type="password" class="form-control" name="repetition">
                        </div>
                        <div class="alert alert-danger" style="display:none" name="errorMessage" role="alert">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="registerSubmit">注册</button>
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>


</body>

</html>